#include<cstdio>
#include<cstring>
using namespace std;
bool a[110];
int main()
{
	freopen("coin.in","r",stdin);
	freopen("coin.out","w",stdout);
	int n,i,j;
	scanf("%d",&n);
	memset(a,0,sizeof(a));
	printf("%d\n",n);
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(i!=j) a[j]=1-a[j];
			printf("%d",a[j]);
		}
		printf("\n");
	}
	return 0;
}
